/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bll;

import dao.ConnectUnit;

import dto.SINHVIEN;
import java.sql.ResultSet;
import java.util.HashSet;

/**
 *
 * @author HUY
 */
public class Bsinhvien {
    ConnectUnit conn;
    
    public Bsinhvien(){
        this.conn = new ConnectUnit();
    }
    public HashSet<SINHVIEN>getSinhviens() throws Exception{
        ResultSet result = this.conn.Select("sinhvien");
        HashSet<SINHVIEN> sinhviens = new HashSet<SINHVIEN>();
        while(result.next()){
            SINHVIEN sinh = new SINHVIEN();
            sinh.setMssv(result.getInt("mssv"));
            sinh.setHoten(result.getString("hoten"));
            sinh.setDiachi(result.getString("diachi"));
            sinhviens.add(sinh);
        }
        return sinhviens;
        
    }
            
}
